
import 'package:flutter/material.dart';
import 'package:flutter_wan_android/res/dimens.dart';

class CommonAppBar extends StatelessWidget{

  final String  title;

  final bool centerTitle;

  const CommonAppBar( this.title,{Key key, this.centerTitle=false}) : super(key: key);



  @override
  Widget build(BuildContext context) {
    return PreferredSize(
        child: AppBar(
          centerTitle: centerTitle,
            title: Text(
              title,
              style: TextStyle(
                fontSize: XDimens.appBarTitleTextSize,
                color: Colors.white,
              ),
            )),
        preferredSize: Size.fromHeight(XDimens.appBarHeight));
  }


 static Widget buildAppBar(BuildContext context,String title,{centerTitle}){
    return CommonAppBar(title,centerTitle: centerTitle,).build(context);
  }

}